﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml;
public class MoverManager : Singleton<MoverManager>
{
    Dictionary<string, XmlNode> xmlMovers = new Dictionary<string, XmlNode>();
    public string XmlPath;
    public void InitFormXml() 
    {
        this.XmlPath = Game.ConfigPath + "Movers.xml";
         
        string strMover = File.ReadAllText(XmlPath);
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(strMover);
        XmlNode node = doc.ChildNodes[0];
        for (int i = 0; i < node.ChildNodes.Count; i++)
        {
            string moverName = node.ChildNodes[i].Attributes["Name"].Value;
            this.xmlMovers[moverName] = node.ChildNodes[i];
        }
    }

    public XmlNode GetXmlMover(string moverName) 
    {
      return xmlMovers[moverName];
    }

  
}
